# !/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author:zzly
@file:views.py
@time:2020/09/08
"""
from rest_framework import generics
from apps.worker.models import Worker
from utils import response_ok
from .serializers import WorkerAppSeializer


class WorkerListView(generics.ListAPIView):
    queryset = Worker.objects.filter(status=True)
    serializer_class = WorkerAppSeializer

    def get(self, request, *args, **kwargs):
        serializer = self.serializer_class(self.get_queryset(), many=True)
        return response_ok(serializer.data)

    def paginate_queryset(self, queryset):
        return None
